package cn.edu.scau.cmi.wujiaxian.exercise11;

import java.awt.FlowLayout;

import javax.swing.JFrame;
import javax.swing.JTextField;

public class WindowActionEvent extends JFrame{
	private static final long serialVersionUID = 4174621914605686809L;

	JTextField text;
	ReaderListen listener;
	
	public WindowActionEvent() {
		init();
		setVisible(true);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	}
	
	void init() {
		setLayout(new FlowLayout());
		text = new JTextField(10);
		listener = new ReaderListen();
		text.addActionListener(listener); //给文本域设置事件
		add(text);
	}
	
}
